package com.ylbh.common.utils;

/**
 * 替换规格枚举
 * @author mgh
 */
public enum ReplaceSpecsEnum {
    /**
     * 颜 色
     */
    COLOR(32774,32831),

    /**
     * 容 量
     */
    CAPACITY(32770,32833),
    /**
     * 重 量
     */
    WEIGHT(32775,32834),
    /**
     * 尺 寸
     */
    DIMENSION(32780,32835),

    /**
     * 尺 码
     */
    Size(32777,32836),

    /**
     * 鞋 码
     */
//    SHOESIZE(32796,32838),
    /**
     * 规格
     */
    SPECS(32794,32794),

    CLOTHINGSPECS(32797, 32797);

    private Integer oldId;
    private Integer newID;

    ReplaceSpecsEnum(Integer oldId,Integer newID) {
        this.oldId = oldId;
        this.newID = newID;
    }

    public Integer getOldId() {
        return oldId;
    }

    public void setOldId(Integer oldId) {
        this.oldId = oldId;
    }

    public Integer getNewID() {
        return newID;
    }

    public void setNewID(Integer newID) {
        this.newID = newID;
    }

    public static Integer getNewId(Integer oldId) {
        ReplaceSpecsEnum[] values = values();
        for (ReplaceSpecsEnum replaceSpecsEnum : values) {
            if (replaceSpecsEnum.getOldId().equals(oldId)) {
                return replaceSpecsEnum.getNewID();
            }
        }
        return null;
    }
}
